import request from '@/utils/request'

// 查询仓库库位列表
export function stationList(query) {
  return request({
    url: '/system_setting/station/list',
    method: 'get',
    params: query,
  })
}

// 查询仓库库位详细
export function getStation(stationId) {
  return request({
    url: '/system_setting/station/' + stationId,
    method: 'get',
  })
}

// 新增仓库库位
export function addStation(data) {
  return request({
    url: '/system_setting/station',
    method: 'post',
    data: data,
  })
}

// 修改仓库库位
export function updateStation(data) {
  return request({
    url: '/system_setting/station',
    method: 'put',
    data: data,
  })
}

// 删除仓库库位
export function delStation(stationIds) {
  return request({
    url: '/system_setting/station/' + stationIds,
    method: 'delete',
  })
}

// 查询仓库看板库位列表
export function stationImsBoard(query) {
  return request({
    url: '/ims_data/productData/ims_board',
    method: 'get',
    params: query,
  })
}

// 查询仓库看板库位详情
export function stationImsBoardDetail(id) {
  return request({
    url: `/ims_data/imsStock/${id}`,
    method: 'get',
  })
}

// 查询仓库看板总览
export function imsBoardOverview(query) {
  return request({
    url: `/system_setting/station/ims_board_overview`,
    method: 'get',
    params: query,
  })
}

export function upImsStockOutWork(data) {
  return request({
    url: '/ims_data/imsStockOutWork',
    method: 'post',
    data: data,
  })
}

export function inventoryInWork(data) {
  return request({
    url: '/ims_data/productData/inventoryInWork',
    method: 'post',
    data: data,
  })
}

export function upImsStockInWork(data) {
  return request({
    url: '/ims_data/imsStockInWork',
    method: 'post',
    data: data,
  })
}

export function clearStation(data) {
  return request({
    url: '/ims_data/productData/clearStation',
    method: 'post',
    data: data,
  })
}

export function initImsWharf(query) {
  return request({
    url: '/system_setting/wharf/initImsWharf/' + query,
    method: 'get',
  })
}

export function reset(imsCode) {
  return request({
    url: `/system_setting/ims/reset/${imsCode}`,
    method: 'get',
  })
}
